package main

import (
	"fmt"
	"time"
)

func main() {
	time1()
}
func time1() {
	now := time.Now()
	fmt.Printf("now:%v  type:%T\n", now, now)
	fmt.Println(now.Year(),now.Month(),int(now.Month()),now.Day(),now.Hour(),now.Minute(),now.Second())
	//格式化日期
	fmt.Println(now.Format("2006-01-02 15:04:05"))
}
